package com.zp.self.module.level_5_设计模式.行为型模式.Ⅲ_命令模式;

import java.util.Map;

/**
 * @author ：by Zeng Peng
 * @date ：Created 2022/7/2 17:04
 * @description ：
 */
public class OrderCommand implements Command{
    public  Order order;
    public SeniorChef seniorChef;
    public OrderCommand(Order order,SeniorChef seniorChef) {
        this.order=order;
        this.seniorChef=seniorChef;
    }

    @Override
    public void execute() {
        System.out.println("餐桌："+order.getDiningTable());
        Map<String, Integer> foodDic = order.getFoodDic();
        for (Map.Entry<String, Integer> entry : foodDic.entrySet()) {
           seniorChef.makeFood(entry.getKey(),entry.getValue());
        }
    }
}
